// Shader Global Variable
// (c) jimon game studio

#ifndef JEH_CSHADERGLOBALVARIABLE_OPENGL
#define JEH_CSHADERGLOBALVARIABLE_OPENGL

#include "IShaderGlobalVariable.h"
#include "IRender.h"

#ifdef JE_RENDER_OPENGL

namespace je
{
	namespace video
	{
		//! Shader Global Variable
		class CShaderGlobalVariable_OpenGL:public je::video::IShaderGlobalVariable
		{
		protected:
			jeStringc CurrentName;
			IRender * CurrentRender;
			ShadersVariablesListType ShaderVariablesList;
			u1 EnableCache;
			u1 EnableIgnoreVoidShaderVariables;
		public:
			//! Constructor
			CShaderGlobalVariable_OpenGL(const jeStringc & Name,IRender * Render);

			//! Destructor
			~CShaderGlobalVariable_OpenGL();

			//! Get Shader Variable Name
			const jeStringc & GetName();

			//! Set Matrix
			void SetMatrix(const jeMatrix4f & Matrix);

			//! Set Matrix 3x3 (set up 3x3 part of 4x4 matrix)
			void SetMatrix3x3(const jeMatrix4f & Matrix);

			//! Set s32
			void Sets32(const s32 * Data,s32 Size);

			//! Set f32
			void Setf32(const f32 * Data,s32 Size);

			//! Set Vector Array
			void SetVector(const jeVector3df * Vector,s32 Size);

			//! Set Vector
			void SetVector(const jeVector3df & Vector);

			//! Set Vector
			void SetVector(const jeVector3di & Vector);

			//! Set Vector
			void SetVector(const jeVector2df & Vector);

			//! Set Vector
			void SetVector(const jeVector2di & Vector);

			//! Set Cached Setup
			void SetCachedSetup(u1 Enable);

			//! Is Cached Setup
			u1 IsCachedSetup();

			//! Is Exist In Shader
			u1 IsExistInShader();

			//! Remove Void Shader Variables
			void RemoveVoidShaderVariables();

			//! Set Ignore Void Shader Variables
			void SetIgnoreVoidShaderVariables(u1 Enable);

			//! Is Ignore Void Shader Variables
			u1 IsIgnoreVoidShaderVariables();

			//! Get Variables List
			ShadersVariablesListType * GetVariablesList();

			//! Register Variable
			void RegisterVariable(IShaderVariable * Variable);

			//! Erase Variable
			void EraseVariable(IShaderVariable * Variable);
		};
	}
}

#endif

#endif
